#pragma once

// Acrobat Headers.
#ifndef MAC_PLATFORM
#include "PIHeaders.h"
#endif

#include "StructExplorer.h"

class MetadataManager
{
	PDDoc _pdDoc;
	ASText m_namespaceName;
	ASText m_namespacePrefix;
public:
	MetadataManager(PDDoc pdd);
public:
	~MetadataManager(void);
public:
	ASText GetMeta(ASText key);
	bool SetMeta(ASText key, ASText value);

	ASText GetH1()
	{
		return ::GetH1(_pdDoc);
	}

	ASText GetPDFVersion()
	{
		ASInt16 majorP = 0;
		ASInt16 minorP = 0;

		PDDocGetVersion(_pdDoc, &majorP, &minorP);

		char str[256];
		
		sprintf(str,"%d.%d", majorP, minorP);
		return ASTextFromPDText(str);
	}
};
